package ever;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Set<String> set = new TreeSet<String>();
		String str;
		while (sc.hasNext()) {
			str =sc.next();
			if (str.equals("!!!!!")) break;
			set.add(str);
		}
		System.out.println(set.size());
		if (set.size() <= 10){
			for (String string : set) {
				System.out.println(string);
			}
		}else{
			for (int n = 0; n < 10; n++) {
				System.out.println(set.toArray()[n]);
			}
		}
	}

}
